package com.jacarrichan.demo.springcloudstream.consumer;

import com.jacarrichan.demo.springcloudstream.model.MessageVO;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.stereotype.Component;

/**
 * kafka消费者监听器（用于spring kafka测试）
 *
 * @author JacarriChan
 * @date 2019/7/27
 */
//@Component
public class KafkaConsumerListener {

    @KafkaListener(topics = "${kafka.topic}")
    public void onMessage(GenericMessage message) {
        System.out.println("非stream集成的kafka消费监听器：" + message);
    }

    @KafkaListener(topics = "${test.kafka.topic}")
    public void myOnMessage(GenericMessage message) {
        System.out.println("这是自定source测试 - kafka消费监听器：" + message);
    }
}
